#pragma once

#include "Ability/EditorAbilityViewModel.h"
#include "EditorMaterialPreviewAbilityModel.h"
#include "EditorMaterialPreviewAbilityViewModel.m.h"

class REditorMaterialPreviewAbilityModel;
class RScene;
class RTexture2D;

RCLASS()
class REditorMaterialPreviewAbilityViewModel : public REditorAbilityViewModel
{
    ROBJECT

public:
    void BindModel(TSharedObjectPtr<REditorAbilityModel> InModel) override;
    virtual TSharedObjectPtr<RTexture2D> GetIcon() const override;
    virtual TSharedObjectPtr<RTexture2D> GetHighlightIcon() const override;

protected:
    TWeakObjectPtr<REditorMaterialPreviewAbilityModel> MaterialPreviewModel;
    TSharedObjectPtr<RTexture2D> Icon;
    TSharedObjectPtr<RTexture2D> HighlightIcon;

public:
    bool HasPreviewMaterial() const;

    TSharedObjectPtr<RScene> PreviewScene;
    
protected:
    TSharedObjectPtr<RMaterial> GetSceneMaterial() const;

};
